#!/usr/bin/env python

import sys, os, os.path
import md5

def useradd ( login, passwd ):
	pwd = open ( "ctppasswd", "a" )
	login = login.lower()
	passwd = md5.new ( passwd ).hexdigest()
	pwd.write ( "%s:%s\n" % ( login, passwd ) )


if __name__ == '__main__':

	if len(sys.argv) < 3:
		print "Usage: %s <login> <passwd>" % sys.argv[0]
		sys.exit(0)

	useradd ( sys.argv[1], sys.argv[2] )


